<div>
	<div class="table" ng-controller="StudentAcedemicsCntlr">
		<div class="panel panel-primary">
			<!-- Default panel contents -->
			<!-- <div class="panel-heading">Search</div> -->
			<div class="panel-body">
			<form novalidate class="simple-form">
				<table class="table table-condensed">
					<tr>
						<td width="5%">Grade</td>
						<td width="10%"><select class="form-control input-sm" ng-model="searchCriteria.gradeId" ng-change="criteriaChanged()" ng-options="c.id as c.value for c in gradeList"></select></td>
						<td width="5%">Term</td>
						<td width="10%"><select class="form-control input-sm" ng-model="searchCriteria.termId" ng-change="criteriaChanged()" ng-options="t.id as t.value for t in termList"></select></td>
						<td width="5%"></td>
						<td><button type="button" class="btn btn-success btn-sm" ng-click="getDetails()">Get
								Details</button></td>
					</tr>
				</table>
			</form>
			</div>
		</div>
		<div class="panel panel-primary" ng-show="showGrid">
		<!-- Button trigger modal -->
			<!-- Default panel contents -->
			<div class="panel-heading">Student Details</div>
			<div class="panel-body">
				<table class="table">
					<tr>
						<td colspan="8">
							<div class="table">
								<div>
									<form editable-form name="studentAcademicForm" onaftersave="saveTable()"
										oncancel="cancel()">
										<!-- table -->
										<table
											class="table table-bordered table-hover table-condensed">
											<tr style="font-weight: bold; background-color: #f4f4f4;">
												<td style="width: 15%">Subject</td>
												<td style="width: 15%">Marks</td>
												<td style="width: 10%">Grades</td>
												<td style="width: 15%">MaxMarks</td>
												<td style="width: 5%">Weightage</td>
												<td style="width: 30%">Remarks</td>
												<td style="width: 10%"><span
													ng-show="studentAcademicForm.$visible">Action</span></td>
											</tr>
											<tr ng-repeat="academicVo in academicVos | filter:filterAcademics">
												<td>
													<!-- editable username (text with validation) --> <span
													editable-select="academicVo.subjectId" e-form="studentAcademicForm"
													e-ng-options="s.id as s.subjectName for s in subjects"
													>{{showSubject(academicVo)}}</span>
												</td>
												<td> 
												<span editable-text="academicVo.marks" e-form="studentAcademicForm">
            									{{ academicVo.marks || 'Not Specified' }}
          										</span></td>
          										<td>
												<span
													editable-select="academicVo.gradePointId" e-form="studentAcademicForm"
													e-ng-options="s.id as s.value for s in gradePoints"
													>{{showGradePoint(academicVo)}} </span>
          										</td>
          										<td>
												<span editable-text="academicVo.maxMarks" e-form="studentAcademicForm">
            									{{ academicVo.maxMarks || 'Not Specified' }}
          										</span></td>
          										<td>
          										<span editable-text="academicVo.attributeWeightage" e-form="studentAcademicForm">
            									{{ academicVo.attributeWeightage || '' }}
          										</span></td>
          										</td>
												
          										<td>
          										<span editable-textarea="academicVo.remarks" e-form="studentAcademicForm">
            									{{ academicVo.remarks || '' }}
          										</span></td>
          										</td>
												<td><button type="button" ng-show="studentAcademicForm.$visible"
														ng-click="deleteAcademicRow(academicVo.cid, academicVo.sid)"
														class="btn btn-danger pull-right">Del</button></td>
											</tr>
										</table>
										<!-- buttons -->
										<div class="btn-edit">
											<button type="button" class="btn btn-default"
												ng-show="!studentAcademicForm.$visible" ng-click="studentAcademicForm.$show()">
												edit</button>
										</div>
										<div class="btn-form" ng-show="studentAcademicForm.$visible">
											<button type="button" ng-disabled="studentAcademicForm.$waiting"
												ng-click="addAcademicRow()" class="btn btn-default pull-right">add
												row</button>
											<button type="submit" ng-disabled="studentAcademicForm.$waiting"
												class="btn btn-primary">save</button>
											<button type="button" ng-disabled="studentAcademicForm.$waiting"
												ng-click="studentAcademicForm.$cancel()" class="btn btn-default">cancel</button>
										</div>
									</form>
									<div  class="panel  panel-default">
										<div class="panel-heading"> Attachment Details
										<button data-toggle="modal" data-target="#myModal" class="btn btn-sm btn-success pull-right" ng-click="initFileParams(searchCriteria,{recordType:'ACADEMICS'},handleAttachImage)">Attach Reports</button> 
										</div>
										<div class="Panel-body">
										<div class="row" ng-show="academicExtraInfo.list">
											<div>
												<table class="table">
													<tr>
														<th>#</th>
														<th>File Name</th>
														<th>Action</th>
													</tr>
													<tr ng-repeat="attachment in academicExtraInfo.list">
														<td>{{attachment.id}}</td>
														<td>{{attachment.name}}</td>
														<td>
														<a target="_self" ng-href="/mc-mvc/shared/filedownload/{{attachment.id}}">
															<button class="btn btn-success btn-sm" type="button">Download</button>
														</a>
															<button ng-click="deleteFile('ACADEMICS',attachment.id,handleDeleteImage)" class="btn btn-danger btn-sm"
																type="button">Delete</button></td>
													</tr>
												</table>
											</div>
										</div>
										<div class="row" ng-show="!academicExtraInfo.list">
											No Attached Images</div>
										</div>
									</div>
									
									<div  class="panel  panel-default">
										<div class="panel-heading"> Recommendations
										<button data-toggle="modal" data-target="#recommendationModule" class="btn btn-sm btn-success pull-right" ng-click="initRecommendations(searchCriteria)">Add recommendations</button> 
										</div>
										<div class="Panel-body" >
										<div style="font-size: 12px">
											<div ng-show="showRecommendation==true">
												<p class="message " ng-repeat="row in recommendations">
													<a class="name" href="#" data-toggle="modal" data-target="#recommendationModule"  ng-click="initRecommendations(searchCriteria,row)">{{row.recommendationtitle || 'No Title'}}</a><br> <span ng-attr-id="{{ 'rdiv-' + $index }}">{{row.recommendationText || 'No Text'}}</span>
												</p>
											</div>
											<div class="row" ng-show="showRecommendation==false">
											No Recommendations Added</div>
										</div>
										</div>
									</div>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>